home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / misc / Logon_098.lha / amitcp / bin / startnet
AmigaDOS Script File  |  1996-12-02  |  3KB  |  111 lines

  1. .key IP,HN/K,DEST/K,MASK/K,GW/K,USER/K,SRV/S,BOOTP/S,UMASK/K,S2CF/K,S2OPT/K,IFACE/K,DEBUG/S
  2. .bra {
  3. .ket }
  4. ;
  5. ; AmiTCP/IP startnet script
  6. ;
  7. ; Copyright © 1994 AmiTCP/IP Group,
  8. ;                  NSDi - Network Solutions Development Inc., Finland
  9. ;                  All rights reserved.
  10. ;
  11. ; *NOTE*  NORMALLY YOU SHOULD USE THE PROVIDED CONFIGURATION UTILITY
  12. ; *NOTE*  TO CHANGE THE CONFIGURATION.  IF YOU NEED TO CHANGE THE 
  13. ; *NOTE*  CONFIGURATION MANUALLY, RESTRICT ANY MODIFICATIONS TO THIS 
  14. ; *NOTE*  "DEF" SECTION.
  15. ;
  16. ; IP address if known, _nothing_ otherwise
  17. .def IP    0.0.0.0
  18. ; Our full host name and aliases if known, _nothing_ otherwise
  19. ; (if this is set, the IP _must_ be set, too)
  20. .def HN    ""
  21. ; The destination address, needed only if GW is not good destination
  22. .def DEST  
  23. ; netmask if known, _nothing_ otherwise
  24. .def MASK  
  25. ; IP address of the default gateway if known, _nothing_ otherwise
  26. .def GW    
  27. ; Default login name
  28. .def USER marc_albrecht
  29. ; User's file creation mask
  30. .def UMASK 022
  31. ; "SRV" if servers are used, _nothing_ otherwise
  32. .def SRV   SRV
  33. ; "BOOTP" if bootstrap protocol is used, _nothing_ otherwise
  34. .def BOOTP 
  35. ; Interface name
  36. .def IFACE cslip0
  37. ; Sana-II device configuration file, _nothing_ otherwise
  38. .def S2CF  cslip0.config
  39. ; Sana-II device configuration to be stored into the configuration file
  40. .def S2OPT "duart.device 0 115200 0.0.0.0 MTU=1006 7WIRE EOFMODE"
  41. ;
  42. ; *NOTE*  YOU SHOULD NOT NEED TO EDIT ANYTHING BELOW. IF YOU NEED TO ADD
  43. ; *NOTE*  CONFIGURATIONS OF ADDITIONAL INTERFACES OR TO START UTILITIES,
  44. ; *NOTE*  DO IT IN THE AmiTCP:db/User-Startnet.
  45. ;
  46. ; Set the failat level so that the errors can be handled by the script
  47. FailAt 21
  48. ; Log in
  49. echo
  50. echo login: {USER}
  51. AmiTCP:bin/login -f {USER}
  52. AmiTCP:bin/umask {UMASK}
  53. run AmiTCP:AmiTCP {DEBUG}
  54. sys:rexxc/WaitForPort AMITCP
  55. If NOT Warn
  56.   ; Create Sana2 configuration file if used
  57.   If NOT X EQ "X{S2CF}"
  58.     ; Assure that ENV:Sana2 exists
  59.     If NOT Exists ENV:Sana2
  60.       MakeDir ENV:Sana2
  61.     EndIf
  62.     ; Create configuration file
  63.     Echo "{S2OPT}" >ENV:Sana2/{S2CF}
  64.   EndIf
  65.   ; Do we need loopback?
  66.   If X EQ "X{SRV}"
  67.     Set LOOPBACK=""
  68.   Else
  69.     Set LOOPBACK="LOOPBACK"
  70.   EndIf
  71.   ; Configure interface
  72.   AmiTCP:bin/bootpconfig {IFACE} IP {IP$*} DEST {DEST$*} MASK {MASK$*} GW {GW$*} $LOOPBACK {BOOTP} {DEBUG}
  73.   If NOT Warn
  74.     If NOT X EQ "X{HN}"
  75.       sys:rexxc/rx "address AMITCP; 'ADD HOST {IP} {HN}'"
  76.     Else
  77.       If NOT X EQ "X{DEBUG}"
  78.         echo "Quering Name Server for the host name..."
  79.       EndIf
  80.     EndIf
  81.     setenv HOSTNAME `AmiTCP:bin/hostname`
  82.     Assign TCP: Exists >NIL:
  83.     IF Warn
  84.       Mount TCP: from AmiTCP:devs/Inet-Mountlist
  85.     EndIf
  86.     ; Start the internet `super server' if wanted
  87.     If NOT X EQ "X{SRV}"
  88.       If X EQ "X{DEBUG}"
  89.         Run <NIL: >NIL: AmiTCP:bin/inetd
  90.       Else
  91.         Run AmiTCP:bin/inetd {DEBUG}
  92.       EndIf
  93.     EndIf
  94.     ;
  95.     ; Configure any additional interfaces & start utilities in 
  96.     ; AmiTCP:db/User-Startnet
  97.     ;
  98.     If Exists AmiTCP:db/User-Startnet
  99.       Execute AmiTCP:db/User-Startnet
  100.     EndIf
  101.   Else
  102.     Echo Interface {IFACE} configuration failed!
  103.     Echo Stopping AmiTCP
  104.     AmiTCP:bin/stopnet FLUSH
  105.   EndIf
  106. Else
  107.   Echo AmiTCP couldn't be started!
  108. EndIf
  109.  
  110. ; EOF
  111.